//package com.example.demo.util;
//
//import org.springframework.stereotype.Service;
//import org.springframework.util.StringUtils;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//@Service
//public class QueryServiceImpl extends EsSearchServiceImpl<EsQueryBean> {
//
//    @Override
//    public List<EsQueryBean> query(PageParam pageParam, QueryParam queryParam) {
//        String queryContent = queryParam.getQueryContent();
//        String name = queryParam.getName();
//        String sex = queryParam.getSex();
//
//        BoTermQuery boTermQuery = BoTermQuery.create();
//        BoTermQuery.Should should = BoTermQuery.Should.create(1);
//        if (!StringUtils.isEmpty(queryContent)) {
//            should.addMatchCondition(queryContent, "name", "content");
//            boTermQuery.addShouldCondition(should);
//        }
//        if (!StringUtils.isEmpty(sex)) {
//            boTermQuery.addTermCondition("sex", sex);
//        }
//        if (name != null) {
//            boTermQuery.addMatchCondition("name", name);
//        }
//        //List<EsQueryBean> esQueryBeans = this.queryList(pageParam, boTermQuery, EsQueryBean.class);
//        List<String> highlightFields = new ArrayList<>();
//        highlightFields.add("content");
//        List<EsQueryBean> esQueryBeans = this.queryListHighlight(pageParam, boTermQuery, highlightFields,
//                "query", EsQueryBean.class);
//        return esQueryBeans;
//
//    }
//
//    @Override
//    public BaseRecord queryDetail(EsComprehensiveQueryBean esComprehensiveQueryBean) {
//        String sourceTableType = esComprehensiveQueryBean.getSourceTableName();
//        EnumPeopleInfoTable tableEnum = EnumPeopleInfoTable.getEnumByTableName(sourceTableType);
//        if (tableEnum == null) {
//            log.info("没有此人员信息资源表：" + sourceTableType);
//            throw new ExceptionBizSystem(EnumResponseCode.REQUEST_INTERFACE_PEOPLE_INFO_TABLE.code, EnumResponseCode.REQUEST_INTERFACE_PEOPLE_INFO_TABLE.message);
//        }
//        Map<String, Object> param = new HashMap<>();
//        param.put("idCard", esComprehensiveQueryBean.getIdCard());
//        Object obj = daoPeopleInfoQuery.findByParam(param, tableEnum.clazz);
//        return (BaseRecord) obj;
//    }
//}
